/**
 *
 * @(#)buttonHandler.java    Jul 19, 2010
 *
 * Copyright 2010 QinYu, Inc. All rights reserved.
 *
 */
package com.ligux.handler;

import android.view.View;
import android.view.View.OnClickListener;
import com.ligux.flzyup.R;
import com.ligux.util.Common;
import com.ligux.util.Constant;

/**
 *
 * @author Johnny Lu
 *
 */
public class ButtonHandler implements OnClickListener {

	/* (non-Javadoc)
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	public void onClick(View btnView) {
		String[] items;
		switch (btnView.getId()) {
		case R.id.btnReboot:
			items = btnView.getResources().getStringArray(R.array.reboot);
			Common.showMessage(btnView.getContext(), Constant.CMD_REBOOT, items[0], items[1]);
			break;

		case R.id.btnRecovery:
			items = btnView.getResources().getStringArray(R.array.recovery);
			Common.showMessage(btnView.getContext(), Constant.CMD_RECOVERY, items[0], items[1]);
			break;

		case R.id.btnBootloader:
			items = btnView.getResources().getStringArray(R.array.bootloader);
			Common.showMessage(btnView.getContext(), Constant.CMD_BOOTLOADER, items[0], items[1]);
			break;

		case R.id.btnShutdown:
			items = btnView.getResources().getStringArray(R.array.shutdown);
			Common.showMessage(btnView.getContext(), Constant.CMD_SHUTDOWN, items[0], items[1]);
			break;

		default:

			break;
		}
	}

}
